Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added CORSMiddleware to allow Dug to make CORS requests #326

Merged
merged 1 commit into from
Nov 8, 2023

Conversation

gaurav
Copy link
Collaborator

@gaurav gaurav commented Oct 17, 2023

While working with Dug locally, I noticed that it doesn't provide CORS headers (presumably because it expects Kubernetes to do this). Since the API is intended to be used by anybody, I thought it wouldn't hurt to add CORSMiddleware to explicitly allow all direct API requests from browsers, but this is not my area of expertise, so please feel free to ignore this if this isn't ideal or if there is a better way to do this.

@gaurav gaurav requested a review from YaphetKG October 17, 2023 14:13
@gaurav gaurav marked this pull request as ready for review October 17, 2023 14:13
@YaphetKG
Copy link
Contributor

YaphetKG commented Nov 8, 2023

@gaurav , I think it might be solvable at the Ingress level. Which instance was doing so?

@YaphetKG
Copy link
Contributor

YaphetKG commented Nov 8, 2023

but it doesn't hurt to have this . I wonder if the issue will still persist if we don't change the ingress thou

@YaphetKG YaphetKG merged commit 13b2113 into develop Nov 8, 2023
8 checks passed
@YaphetKG YaphetKG deleted the add-cors-middleware branch November 8, 2023 17:02
@gaurav
Copy link
Collaborator Author

gaurav commented Nov 8, 2023

Which instance was doing so?

I ran into this while running Dug locally, so no ingress -- just running uvicorn directly with the backend running in Docker, I think.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants